#include "calculation.hpp"
#include <cmath>
#include <iostream>

static double f(double x) { return std::pow(x, 3) - 3 * std::sin(x); }

constexpr double eps = 0.0001;
constexpr double dx = 0.1;
constexpr double x1 = 0.4;
int main() {
  double min = calculate_minimum(f, x1, dx, eps);
  double f_min = f(min);
  std::cout << "Min X: " << min << "\n"
            << "F(x): " << f_min << std::endl;
  return EXIT_SUCCESS;
}